<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!doctype html>
<html>
<head>
<jsp:include page="../common/import.jsp"></jsp:include>
</head>
<body class="bgfff">

<div class="header">
	<div class="container clear">
    	<a class="fl" href="http://www.wangpos.com/home/index/"><img src="http://www.wangpos.com/public/images/logo.png" alt="旺POS"></a>
        <a class="fl cfff f16" href="javascript:">&#8226;&nbsp;代理商平台</a>
        <!--<a class="fr cfff" href="javascript:">代理商平台</a>-->
    </div>
</div>

<%-- <div class="login">
	<div class="container h350 clear">
    	<form class="fr mt150 mr100 pr50" action="${pageContext.request.contextPath}/user/login.xhtml" method="POST" onsubmit="return login();">
        	<div class="fr mt150 mr100 pr50" >
        	<p class="f30">用户登录</p>
            <div class="clear b b-radius mt10">
            	<span class="iconfont fl p10 br h20">&#xf00ec;</span>
                <input id="username" name="username" class="p10 b-none w300 h20" type="text" placeholder="用户名">
            </div>
            <div class="clear b b-radius mt10">
            	<span class="iconfont fl p10 br h20">&#xf00c9;</span>
                <input id="password" name="password" class="p10 b-none w300 h20" type="password" placeholder="密码">
            </div>
            
            <button id="next" type="button" class="w mt10 h20 pt10 pb10 cfff bg286090 b-radius" onclick="login()">登录</button>
        	</div>
        <!-- </form> -->
    </div>
</div>
 --%>
<div class="login">
	<div class="container clear pr">
    	<!-- <form class="fr mt150 mr100 pr50"> -->
    	<div class="fr mt150 mr100 pr50">
        	<p class="f30">用户登录</p>
            <div class="clear b b-radius mt10">
            	<span class="iconfont fl p10 br h20">&#xf00ec;</span>
                <input id="username" name="username" class="p10 b-none w300 h20" type="text" placeholder="用户名">
            </div>
            <div class="clear b b-radius mt10">
            	<span class="iconfont fl p10 br h20">&#xf00c9;</span>
                <input id="password" name="password" class="p10 b-none w300 h20" type="password" placeholder="密码">
            </div>
            
            <button id="next" onclick="login()" class="w mt10 h20 pt10 pb10 cfff bg286090 b-radius" type="submit">登录</button>
        </div>
        <!-- </form> -->
        <img class="login-ewm" src="${base}/agent/qrcode/show.xhtml" width="131" height="131">
        <a href="${base}/agent/public/apk/easywork.apk">
        <button class="login-btn f24 c1eb9ef w200 h50 bgfff b-radius" ><span class="iconfont f24 mr10">&#xf01c9;</span>Android</button>
        </a>
    </div>
</div>


<!-- <div class="footer mt50" style="border-bottom:0">
	<div class="clear container">
		<div class="fl">
            <span>京ICP备 13021939号-28</span>
            <a class="ml20" href="http://www.wangpos.com/app/about#5" target="_blank">联系我们</a>
            <a class="ml10" href="http://weibo.com/u/5446650933" target="_blank"><img src="http://mp.wangpos.com/public/images/icon_weibo.png"></a> 
            <a class="ml10" href="javascript:"><img src="http://mp.wangpos.com/public/images/icon_weixin.png"></a>
            
		</div>
		<a class="fr" href="http://www.wangpos.com/app/about#1" target="_blank">北京微智全景信息技术有限公司</a>
	</div>
</div> -->
<jsp:include page="../common/footer.jsp"></jsp:include>
<script type="text/javascript">

function login(){
	var username = document.getElementById("username").value;
	var password = document.getElementById("password").value;
	//alert("username:"+username+"password:"+password);
	//var url= ${pageContext.request.contextPath}+"/user/login";
	//var data = {"username":username,"password":password};
	if(username==''||username==null){
		alert("用户名不能为空");
		return;
	}
	if(password==''||password==null){
		alert("密码不能为空");
		return;
		}
	var url="${base}/agent/user/login.xhtml";
	var data = {"username":username,"password":password};
	$.post(url, data, function(data){
		//alert(data.msg);
		if (data.erroCode==0) {
			alert(data.msg);
			 location.reload(true);
 		}
 		if(data.erroCode==1){
			
 			window.location.href=data.url;
 		}
 	},
 	"json"
 	);
	//window.location.href =${pageContext.request.contextPath}+"/user/login.xhtml?username="+username+"&password="+password;
	//return true;
	/* 	$.post(url, data, null);
	$.post(url, data, function(){
		alert("成功");
	}); */
};

</script>
</body>
</html>